package ylg.com.cn.beuty.main.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by MyPC on 2017/1/14.
 */
public class MyPagerAdapter extends FragmentPagerAdapter {

    private Fragment  fragments[];
    private FragmentManager fm;

    public MyPagerAdapter(FragmentManager fm,Fragment  fragments[]) {
        super(fm);
        this.fm = fm;
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return fragments.length;
    }
}
